<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<title>注册</title>
		<link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
	</head>
	<body>
		<div class="bg">
			<div class="reg">
				<div class="phone">
					<label class="pic_phone">
						<img src="img/phone.png"/>
					</label>
					<input class="in_phone" type="number" placeholder="请输入手机号码"/>
				</div>
				<!--<div class="phone" style="margin-top:0.28rem;">
					<label class="codeImg">
						<img src="img/code.png"/>
					</label>
					<input class="in_password" type="password" placeholder="请输入密码"/>
				</div>
				<div class="phone" style="margin-top:0.28rem;">
					<label class="codeImg">
						<img src="img/code.png"/>
					</label>
					<input class="confirm_password" type="password" placeholder="请确认密码"/>
				</div>-->
				<div class="phone_code">
					<div class="pic_code_left">
						<label class="codeImg">
							<img src="img/code.png"/>
						</label>
						<input class="in_left" type="number" placeholder="请输入验证码"/>
					</div>
					<div class="pic_code_right">
						<button class="code">获取验证码</button>
					</div>
				</div>
			</div>
			<div class="register_button">立即注册</div>
			<div class="notice">
				<span>阅读并同意</span>
				<span>《用户注册协议》</span>
			</div>

			<div class="downNow">立即下载APP</div>

			<div class="mask" style="display: none;position: absolute;top: 0;"></div>


		</div>
	</body>
	<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
	<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
    function is_weixn_qq(){
      var ua = navigator.userAgent.toLowerCase();
      if(ua.match(/MicroMessenger\/[0-9]/i)){
        return "weixin";
      }
      if(ua.match(/QQ\/[0-9]/i)){
        return "QQ";
      }
      return false;
    }

    // if (is_weixn_qq()) {
    //   $('.bg').remove()
    // } else {
      document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
      $(".bg").height($(window).height())
      $(".mask").height($(window).height())

      var companyId=getQueryString("companyId");
      var encrypt=getQueryString("encrypt");


      var regUrl='http://mykd.codesweetie.com:7000/deskManagementController/register'
      var SmsUrl='http://mykd.codesweetie.com:7000/deskManagementController/channelSms'
    var downLink='https://www.dongxugj.com/go/ziYRV3'


    $.ajax({
        type:"post",
        url:"http://mykd.codesweetie.com:7000/StatisticsDataController/saveChannelClick",
        data:{
          encrypt:encrypt
        },
        success:function(res){
        }
      });


      $(".code").click(function(){
        let phone=$(".in_phone").val();
        let params = {
          userAppPhone: phone,
          encrypt: encrypt,
          type: 1,
        }
        ajaxRequest(SmsUrl, params, function(data) {
          if(data.state == 1) {
            mui.toast("获取成功");
            $(".in_left").val(data.info.code);
          }
        });
      })

      $(".register_button").click(function(){
        let phone=$(".in_phone").val();
//			let password=$(".in_password").val();
//			let OldPassword=$(".confirm_password").val();
        let code=$(".in_left").val();
//			if(OldPassword != password){
//				mui.toast("两次输入的密码不一致", { duration:1000, type:'div' })
//				return;
//			}
        let params = {
          userAppPhone:phone,
          encrypt:encrypt,
          password:'',
          msgCode:code,
          ip:returnCitySN["cip"],
        }
        ajaxRequest(regUrl, params, function(data) {
          if(data.state==1){
            window.location.href = './down_load.html'
          }
        });
      })



      $('.downNow').click(function(){
        var u = navigator.userAgent, app = navigator.appVersion;
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
        if (isAndroid) {
          $(".android").show()
          window.location.href = downLink
//			    var src = 'https://cn7l.cn/7Ag7';
//				var iframe = document.createElement('iframe');
//				iframe.style.display = 'none';
//				iframe.src = "javascript: '<script>location.href=\"" + src + "\"<\/script>'";
//				document.getElementsByTagName('body')[0].appendChild(iframe);
        }
        if (isIOS) {
          $(".ios").show()
          window.location.href = downLink
        }
      })
    // }
	</script>
</html>
